package com.core.gui.main;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import com.core.dao.impl.DBUtil;
import com.core.gui.dialog.LoginDialog;
import com.core.gui.dialog.RegistrationDialog;
import com.core.gui.helper.UserInfo;

public class Main {

	/**
	 * @param args
	 * @throws SQLException 
	 */
	
	public static void main(String[] args) throws SQLException {
		try {

			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (UnsupportedLookAndFeelException e) {
			// handle exception
		} catch (ClassNotFoundException e) {
			// handle exception
		} catch (InstantiationException e) {
			// handle exception
		} catch (IllegalAccessException e) {
			// handle exception
		}
	

		if(UserInfo.getInstance().getService().getUsernamSrv().isAdminCreatedBefor()){
			new LoginDialog().setVisible(true);
		}else{
			new RegistrationDialog().setVisible(true);
		}

	}

}
